package com.tarena.lbs.coupon.pojo.po;

import com.alibaba.fastjson2.util.DateUtils;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;


@Data
@TableName("coupon")
public class CouponPO implements Serializable {

    private Integer id;

    private String couponName;

    private Integer couponType;

    private BigDecimal discountValue;

    private BigDecimal maxDiscountAmount;

    private String applicable;

    private Integer usageLimit;

    private Integer maxUsageLimit;

    @NotEmpty(message = "开始时间不能为空")
    @Schema(description ="开始时间")
    private Date startDate;

    @NotEmpty(message = "截止时间不能为空")
    @Schema(description ="截止时间")
    private Date endDate;

    private Integer status;

    private String describes;

    private Integer businessId;

    private Date createAt;

    private Date updateAt;

    private Integer usageNum;

    private Integer enableStatus;

    private Integer exclusionType;

    private BigDecimal orderAmount;

    public void setStartDate(String startDate) {
        this.startDate = DateUtils.parseDate(startDate);
    }

    public void setEndDate(String endDate) {
        this.endDate = DateUtils.parseDate(endDate);
    }
}